<?xml version='1.0' encoding='ISO-8859-1' ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"   
      xmlns:jb="http://java.sun.com/jsf/composite/componentes"
      xmlns:p="http://primefaces.org/ui">

    <SCRIPT language="JavaScript" type="text/javascript">
                   
        function handleRequestCosto(xhr, status, args) {                     
            if(args.validationFailed || !args.CallbackParam) {  
                
            } else {                              
                carDialogCosto.hide();  
                jQuery('#btnGuardarCosto').fadeOut();  
            }
        }  
    </SCRIPT>
    <h:form onsubmit="return checkSubmit();"  id="frmCosto">
        <h:panelGrid id="pgFormDtoCosto" frame="box">
            <h:panelGrid  columns="4" cellpadding="4">
                
                <h:outputLabel for="itValidoDesde" value="#{i18n['form.maquina.valido.desde']}" styleClass="label"/>
                <p:calendar id="itValidoDesde" value="#{maquinaMBean.detaCostoDto.validoDesde}" label="#{i18n['form.maquina.valido.desde']}" pattern="#{applicationMBean.formatoFecha}"  required="true"
                            style="#{applicationMBean.estiloObligatorio}" disabled="#{sessionMBean.accionDetalle == applicationMBean.ver}"> 
                </p:calendar>
                
                <h:outputLabel for="itValorCompra" value="#{i18n['form.maquina.valor.compra']}" styleClass="label"/>
                <p:inputText id="itValorCompra" label="#{i18n['form.maquina.valor.compra']}" style="#{applicationMBean.estiloObligatorio}"
                             value="#{maquinaMBean.detaCostoDto.valorCompra}" readonly="#{sessionMBean.accionDetalle == applicationMBean.ver}"
                             onkeypress="return fn_validaTecla('decimal',this)"
                             required="false" size="10">
                    <f:validateLength minimum="1" maximum="9"/>
                    <f:convertNumber pattern="#{applicationMBean.formatoMontos}"/>
                </p:inputText>
                
                <h:outputLabel for="itValorCosto" value="#{i18n['form.maquina.costo']}" styleClass="label"/>
                <p:inputText id="itValorCosto" label="#{i18n['form.maquina.costo']}" style="#{applicationMBean.estiloObligatorio}"
                             value="#{maquinaMBean.detaCostoDto.costo}" readonly="#{sessionMBean.accionDetalle == applicationMBean.ver}"
                             onkeypress="return fn_validaTecla('decimal',this)"
                             required="false" size="10">
                    <f:validateLength minimum="1" maximum="9"/>
                    <f:convertNumber pattern="#{applicationMBean.formatoMontos}"/>
                </p:inputText>
                
                <h:outputLabel for="itUMCosto" styleClass="label" value="#{i18n['form.maquina.um.costo']}"/>
                <p:selectOneMenu id="itUMCosto" value="#{maquinaMBean.detaCostoDto.umCostoDto}"  converter="parametroConvert"  disabled="#{sessionMBean.accionDetalle == applicationMBean.ver}"
                                 style="#{applicationMBean.estiloObligatorio}" required="true">
                    <f:selectItems value="#{maquinaMBean.listaUMCosto}" var="parametroDto"  itemLabel="#{parametroDto.descripcion}" itemValue="#{parametroDto}"/>
                </p:selectOneMenu>
                
                <h:outputLabel for="itImporteUtillaje" value="#{i18n['form.maquina.importe.utillaje']}" styleClass="label"/>
                <p:inputText id="itImporteUtillaje" label="#{i18n['form.maquina.importe.utillaje']}" style="#{applicationMBean.estiloObligatorio}"
                             value="#{maquinaMBean.detaCostoDto.importeUtillaje}" readonly="#{sessionMBean.accionDetalle == applicationMBean.ver}"
                             onkeypress="return fn_validaTecla('decimal',this)"
                             required="false" size="10">
                    <f:validateLength minimum="1" maximum="9"/>
                    <f:convertNumber pattern="#{applicationMBean.formatoMontos}"/>
                </p:inputText>
                
                <h:outputLabel for="itAmortizacion" value="#{i18n['form.maquina.amortizacion']}" styleClass="label"/>
                <p:inputText id="itAmortizacion" label="#{i18n['form.maquina.amortizacion']}" style="#{applicationMBean.estiloObligatorio}"
                             value="#{maquinaMBean.detaCostoDto.amortizacion}" readonly="#{sessionMBean.accionDetalle == applicationMBean.ver}"
                             onkeypress="return fn_validaTecla('decimal',this)"
                             required="false" size="10">
                    <f:validateLength minimum="1" maximum="9"/>
                    <f:convertNumber pattern="#{applicationMBean.formatoMontos}"/>
                </p:inputText>
                
                <h:outputLabel for="itValorAnio" value="#{i18n['form.maquina.valor.anio']}" styleClass="label"/>
                <p:inputText id="itValorAnio" label="#{i18n['form.maquina.valor.anio']}" style="#{applicationMBean.estiloObligatorio}"
                             value="#{maquinaMBean.detaCostoDto.valorAnio}" readonly="#{sessionMBean.accionDetalle == applicationMBean.ver}"
                             onkeypress="return fn_validaTecla('decimal',this)"
                             required="false" size="10">
                    <f:validateLength minimum="1" maximum="9"/>
                    <f:convertNumber pattern="#{applicationMBean.formatoMontos}"/>
                </p:inputText>
                
                <h:outputLabel for="itDiasAnio" value="#{i18n['form.maquina.dias.anio']}" styleClass="label"/>
                <p:inputText id="itDiasAnio" label="#{i18n['form.maquina.dias.anio']}" style="#{applicationMBean.estiloObligatorio}"
                             value="#{maquinaMBean.detaCostoDto.diasAnio}" readonly="#{sessionMBean.accionDetalle == applicationMBean.ver}"
                             onkeypress="return fn_validaTecla('entero',this)"
                             required="false" size="10">
                    <f:validateLength minimum="1" maximum="9"/>
                    <f:convertNumber pattern="#{applicationMBean.formatoMontos}"/>
                </p:inputText>
                
                <h:outputLabel for="itHorasDia" value="#{i18n['form.maquina.horas.dia']}" styleClass="label"/>
                <p:inputText id="itHorasDia" label="#{i18n['form.maquina.horas.dia']}" style="#{applicationMBean.estiloObligatorio}"
                             value="#{maquinaMBean.detaCostoDto.horasDia}" readonly="#{sessionMBean.accionDetalle == applicationMBean.ver}"
                             onkeypress="return fn_validaTecla('entero',this)"
                             required="false" size="10">
                    <f:validateLength minimum="1" maximum="9"/>
                    <f:convertNumber pattern="#{applicationMBean.formatoMontos}"/>
                </p:inputText>
                
                <h:outputLabel for="itHorasImpAnio" value="#{i18n['form.maquina.horas.imp.anio']}" styleClass="label"/>
                <p:inputText id="itHorasImpAnio" label="#{i18n['form.maquina.horas.imp.anio']}" style="#{applicationMBean.estiloObligatorio}"
                             value="#{maquinaMBean.detaCostoDto.horasImpAnio}" readonly="#{sessionMBean.accionDetalle == applicationMBean.ver}"
                             onkeypress="return fn_validaTecla('decimal',this)"
                             required="false" size="10">
                    <f:validateLength minimum="1" maximum="9"/>
                    <f:convertNumber pattern="#{applicationMBean.formatoMontos}"/>
                </p:inputText>                                
            </h:panelGrid>            
        
            <p:panel id="pnlAcciones" rendered="#{sessionMBean.accionDetalle != applicationMBean.ver}">
                <h:panelGrid columns="10">
                    <p:commandButton id="btnGuardarCosto" update=":msjDialogCosto,:frmPrincipal:tabPrincMaquina,:msgs" 
                                     title="#{i18n['general.button.guardar.tip']}"
                                     style="#{applicationMBean.estilosBtnGuardar}"
                                     ajax="true"                                 
                                     icon="ui-icon ui-icon-disk" rendered="#{sessionMBean.accionDetalle != applicationMBean.ver}"
                                     value="#{i18n['general.button.guardar']}" 
                                     action="#{maquinaMBean.guardarCosto}"
                                     oncomplete="handleRequestCosto(xhr, status, args);"
                                     >
                    </p:commandButton>
                </h:panelGrid>
            </p:panel>
        </h:panelGrid>  
    </h:form>
</html>